﻿using System;
using System.Collections.Generic;
using System.Text;
using Lswweb.Model;

namespace Lswweb.IDAL
{
    public interface INews
    {
        /// <summary>
        /// 获取文章实体类
        /// </summary>
        /// <param name="newsId">文章Id</param>
        /// <returns>返回文章实体类</returns>
        NewsInfo GetNews(int newsId);

        NewsInfo GetFirstNews(int categoryId,string language);

        NewsInfo GetNextNews(int newsId, int categoryId, string language);

        NewsInfo GetPrevNews(int newsId, int categoryId, string language);

        /// <summary>
        /// 取得文章实体类集合，排序方式“置顶 + 时间”
        /// </summary>
        /// <param name="searchKey">搜索关键字，可以为空</param>
        /// <param name="searchKeyType">搜索关键字类型</param>
        /// <param name="categoryId">文章类别，可以为0或负值。0是默认值，表示无分类。负值则表示不进行类别区分搜索所有类别文章。</param>
        /// <param name="type">状态类型，可以为非内部枚举值。非内部枚举值表示不进行状态类型区分。</param>
        /// <param name="isHot">是否为推荐新闻</param>
        /// <param name="isTop">是否为置顶新闻</param>
        /// <param name="maxDateTime">搜索时间段最大值，可以为DateTime.MaxValue</param>
        /// <param name="minDateTime">搜索时间段最小值，可以为DateTime.MinValue</param>
        /// <param name="ver">版本 中/英 等</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="pageSize">每页记录条数</param>
        /// <param name="totalRecord">总记录条数</param>
        /// <returns>文章记录集</returns>
        IList<NewsInfo> GetNewsList(string searchKey, SearchKeyType searchKeyType, int categoryId, StatusType type, AuditingStatusType auditingStatus, BooleanType isCommand, BooleanType isTop, DateTime maxDateTime, DateTime minDateTime, string ver,int pageIndex, int pageSize, out int totalRecord);

        /// <summary>
        /// 添加文章信息
        /// </summary>
        /// <param name="newsInfo">信息实体类</param>
        /// <returns>返回新信息的Id</returns>
        int Insert(NewsInfo newsInfo);

        /// <summary>
        /// 更新文章信息
        /// </summary>
        /// <param name="newsInfo">信息实体类</param>
        bool Update(NewsInfo newsInfo);
        bool UpdateIsTop(int newsId, bool isTop);
        bool UpdateIsHot(int newsId, bool isHot);
        bool UpdateStatus(int newsId, StatusType type);
        bool UpdateStatus(int newsId, AuditingStatusType type,string remark);
        bool UpdateCategory(int newsId, int categoryId);
        bool UpdateImageUrl(int newsId, string imageUrl);

        bool UpdateDisplayOrder(int newsId, int displayOrder);

        object GetFieldValue(int newsId, string fieldName);


        /// <summary>
        /// 删除文章
        /// </summary>
        /// <param name="newsId">文章Id</param>
        bool Delete(int newsId);
    }

    public interface INewsSkins
    {
        NewsSkinInfo GetSkin(int categoryId);

        IList<NewsSkinInfo> GetSkins();

        bool UpdateCategorySkin(int categoryId, int skinId);
    }
}
